# -*- coding: utf-8 -*-
class MetaPerson(type):
    pass


class Person(metaclass=MetaPerson):
    pass


def trace_type():
    top = Person()
    print(type(top), top.__class__)
    print(type(Person), Person.__class__)
    print(type(MetaPerson), MetaPerson.__class__)


class BaseClass(type):
    def __new__(cls, *args, **kwargs):
        print("__new__ in BaseClass")
        print(cls)
        return super().__new__(cls, *args, **kwargs)

    def __init__(cls, *args, **kwargs):
        print("__init__ in BaseClass")
        super().__init__(*args, **kwargs)

    def __call__(cls, *args, **kwargs):
        print("__call__ in BaseClass")
        return super().__call__(*args, **kwargs)


class User(metaclass=BaseClass):


    def __init__(self, name):
        super().__init__()
        print("in User")
        self.name = name


def user_test():
    user = User('vincent')


if __name__ == '__main__':
    # trace_type()
    user_test()
